﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DIProject.Sales
{
    public partial class SmallPartiesList : Form
    {
        public SmallPartiesList()
        {
            InitializeComponent();
        }

        private void SmallPartiesList_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'util.SmallParty' table. You can move, or remove it, as needed.
            this.smallPartyTableAdapter.Fill(this.util.SmallParty);

        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            txbFiltr.Text = string.Empty;
            this.smallPartyBindingSource.Filter = string.Empty;
            this.smallPartyTableAdapter.Fill(this.util.SmallParty);
        }
        private string fltr
        {
            get
            {
                string str = txbFiltr.Text;
                if (string.IsNullOrEmpty(str))
                    return string.Empty;
                return str;
            }
        }
        private void btnFiltr_Click(object sender, EventArgs e)
        {
            
            if (!string.IsNullOrEmpty(this.fltr))
                this.smallPartyBindingSource.Filter = "FullName LIKE '*" + this.fltr + "*'";
            else
                this.smallPartyBindingSource.Filter = string.Empty;
        }

        private void btnClearFiltr_Click(object sender, EventArgs e)
        {
            this.smallPartyBindingSource.Filter = string.Empty;
            txbFiltr.Text = string.Empty;
        }
    }
}